<template>
	<div>
		<header class="aui-header">
			<a class="aui-pull-left aui-btn">
				<!--<span class="aui-iconfont aui-icon-left"></span>-->
				<img src="../assets/rightbut.png">
			</a>
			<div class="aui-title">京选友惠</div>
		</header>
		<div class="loadingname">正在加载中...</div>
	</div>
</template>

<script>
	import { BaseUrl } from '../Baseurl/common.js';
	import { InfiniteScroll } from 'mint-ui';
	import { Toast } from 'mint-ui';
	export default {
		data() {
			return {
				id: '',
				loading: false,
				backImg:'',
				singlist: [],
				singjson: [],
				index: 0,
				spuJson:[],
				token:''
			}
		},
		created() {
			//this.singInfo(this.index);
			var href = window.location.href;
//			console.log(href.split('?')[1])
			href = href.substring(href.indexOf('id='),href.length);
//			console.log(href);
			this.id = href.split('=')[1];
			/*var url = BaseUrl +'goods/getSpuEmptyMsg?'+href.split('?')[1];
			this.$http.get(url).then(res => {
				console.log(res.data);
			})*/
			console.log(this.id);
			var linkUrl = BaseUrl +'share/getConLink?id='+this.id;
			this.$http.get(linkUrl).then(res => {
//				console.log(res.data);
				   
					if(res.data.code == "10000"){
						window.location.href = res.data.data;
					}else{
						this.$router.push({
							path: '/filterShare?id=' + res.data.spuId+"&loadId="+this.id
						})
						
						
					}
			})
		},
		methods: {
			/*detailbut:function(){
				var url = BaseUrl +'share/getCommonLink?'+this.id;
				this.$http.get(url).then(res => {
				console.log(res.data);
					if(res.data.code == "10000"){
						window.location.href = res.data.data;
					}else{
						Toast({
							message: res.data.msg,
							position: 'middle',
							duration: 3000
						});
					}
				})
				
			}*/
			
		}	
	}
</script>

<style scoped="scoped">
.loadingname{
	margin-top: 2rem;
	text-align: center;
}
</style>